<template>
  <div>
    <el-form
      ref="tableData"
      :model="tableData"
      label-width="130px"
      size="mini"
    >
      <el-row>
        <el-col :span="12">
          <el-form-item label="现常住地址：">
            <Area-cascader
              @selectedAreaList="selectedAreaList"
              :isCurrentOrgDefaultArea="false"
              :clearable="true"
            ></Area-cascader>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  
  </div>
</template>

<script>
// import { get, downloadFile, post } from "@/apis/apicommon";
import AreaCascader from "../../components/areaCascader.vue";
export default {
  name: "page1",
  components: {
    AreaCascader,
  },
  props: {
    
  },
  data() {
    return {
      formData: {},
      tableData:{}
    };
  },
  created() {

  },
  mounted() {},
  methods: {
    // 地址选中值
    selectedAreaList(val) {
      // 这里是返回的区划name和code，一共有五级
      console.log(val);
      let { provinceCode, cityCode, countyCode, streetCode, communityCode } =
        val.areaCodeObject;
      this.formData.province = provinceCode;
      this.formData.city = cityCode;
      this.formData.county = countyCode;
      this.formData.street = streetCode;
      this.formData.community = communityCode;
      let { provinceName, cityName, countyName, streetName, communityName } =
        val.areaNameObject;
      this.formData.provinceName = provinceName;
      this.formData.cityName = cityName;
      this.formData.countyName = countyName;
      this.formData.streetName = streetName;
      this.formData.communityName = communityName;
    },
  
  },
};
</script>
<style scoped>

</style>